<?xml version='1.0' encoding='UTF-8' ?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" 
      xmlns:f="http://java.sun.com/jsf/core" 
      xmlns:h="http://java.sun.com/jsf/html" 
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:ez="http://java.sun.com/jsf/composite/ezcomp"> 
    <!--
    Author Lu Xiaodi
    -->
    <h:head> 
        <title>IOTR</title> 
        <style type="text/css"> 
            .gritter-notice-wrapper { 
                left:200px; 
                top:50px; 
            } 
        </style> 

    </h:head> 
    <h:body>                 
        <ez:RepHeaderMenu/>

        <h1>TTA - Representative Manager Portal</h1> 

        <p:layout style="table-layout:auto; height:600px ">
            <p:layoutUnit position="left" header="Navigation" width="300">
                <ez:RepTTALeftMenu/>
            </p:layoutUnit>
            <p:layoutUnit position="center" header="Settings">
                <h:outputText style="color: #D20005; font-family: sant-serif; font-weight: bold;
                              font-size: larger"
                              value="Note: CLV is done on a yearly basis."/>
                <h:outputText style="color: #D20005; font-family: sant-serif; font-weight: bold;
                              font-size: larger"
                              value="(if a stakeholder is created less than a year, clv is 99999)."/>

                <br/>
                <h:form>
                    
                    <h:panelGrid columns="2" style="border-bottom-style: groove; border-top-style: groove;
                                 width: 95%; margin: 20px;" >
                        <f:facet name="header">
                            Parameters
                        </f:facet>
                        <h:outputText value="Discount Rate:" />
                        <p:inputText value="#{custAnalysisMB.discountRate}" />
                        <h:outputText value="ACSR(Average customer spending per reservation):"/>
                        <p:inputText value="#{custAnalysisMB.expPerRes}" />
                        <p:commandButton value="Enter" update="clv" actionListener="#{custAnalysisMB.updateCLVParameter}"/>
                        <h:outputText/>
                    </h:panelGrid>

                    <h:panelGrid columns="2" style="border-bottom-style: groove;
                                 width: 95%; margin: 20px">
                        <f:facet name="header">
                            Result
                        </f:facet>
                        <h:outputText value="CLV:"/>
                        <h:outputText id="clv" value="#{custAnalysisMB.CLV}"/>
                    </h:panelGrid>
                </h:form>
            </p:layoutUnit>
        </p:layout>

    </h:body> 
</html>